Return to doc.sitecore.com

Working with Sitecore Performance Counters
Prev Next

Author: Alexey Romaniuha
Posted: 5/5/2010 1:16:55 AM

Sitecore CMS reads and updates a number of Sitecore-specific performance counters that can be used for troubleshooting of Sitecore issues and analyzing the solution performance.
Below is an overview of the Sitecore performance counters' related configuration settings.

1. Configuration settings.

There are the following settings in the Sitecore web.config file:

2. Monitoring Sitecore Performance counters.

The Windows performance monitor can be used to monitor Sitecore-specific performance counters. More information about the Windows Performance monitor can be found on the MSDN.

The Sitecore health monitor is a background task that runs the "healthMonitor" pipeline with an interval specified by the "HealthMonitorInterval" setting. One of the processors of this pipeline logs counter values to log files.

Starting from Sitecore 6.2.0 rev. 100104, this processor supports monitoring Sitecore-specific performance counters, Windows and CLR performance counters.

When adding performance counters to the LogCounterStatus processor, you must specify “instanceType” attribute for every counter. For example: 

 <processor type="Sitecore.Pipelines.HealthMonitor.HealthMonitor, Sitecore.Kernel" method="LogCounterStatus">
                    <counters hint="raw:AddCounter">
                        <counter category="Process" name="Private Bytes" instanceType="Windows" />
                        <counter category=".net CLR Memory" name="# Bytes in all Heaps" instanceType="CLR" />
                        <counter category="Sitecore.Caching" name="CacheMisses" instanceType="Sitecore" />
                    </counters>
                </processor>

The value of the “instanceType” attribute allows Sitecore to determine the name of the counter instance that corresponds to the current web application. This is necessary because running multiple applications on the same machine may have application1 correspond to w3wp counter instance, while application2 will correspond to w3wp#1 instance.

Here’s the sample output caused by the above configuration:

5208 14:46:59 INFO  Health.Counter(w3wp, Process\Private Bytes): 149,172,224
5208 14:47:00 INFO  Health.Counter(w3wp, .net CLR Memory\# Bytes in all Heaps): 49,758,360
5208 14:47:00 INFO  Health.Counter(Default, Sitecore.Caching\CacheMisses): 2,195

The Counter Dump Agent periodically collects data about all Sitecore-specific performance counters using the XML format and writes this data to the files having a path like “/data/diagnosticts/counters.20100428.103711.6060.txt”.
The contents of these files can be used to keep track of Sitecore-specific counters' values for different time periods.

The agent definition looks like this:

 <agent type="Sitecore.Tasks.CounterDumpAgent" method="Run" interval="01:00:00">
        <DumpFile>$(dataFolder)/diagnostics/counters.{date}.{time}.{processid}.txt</DumpFile>
      </agent>

3. Known issues and errors related to performance counters.

Please refer to the following Known Issue for the information about the possible errors and their soultions:
Errors when accessing performance counters


Prev Next